# -*- coding: UTF-8 -*-
# Project : bio_tc
# File : toRedis.py
# IDE : PyCharm
# Author : 博科（鑫贝西）田聪
# Date : 2021/12/3 15:26
import redis
from tools.settings import *

class Redis_DB:
    __new = None
    __init = True

    def __new__(cls, *args, **kwargs):
        if cls.__new is None:
            cls.__new = object.__new__(cls)
        return cls.__new

    def __init__(self):


        pool = redis.ConnectionPool(
                        host=HOST, port=R_PORT, password=R_PASSWORD, max_connections=MAX_CONNECTIONS, decode_responses=True
                    )
        self.r = redis.Redis(connection_pool=pool)
        Redis_DB.__init = False

